package jsyf.oa.entity.device;

import com.alibaba.fastjson.JSONObject;
import jsyf.oa.ientity.BaseEntity;

import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by y on 2018/6/25.
 */
@Entity
@Table(name = "T_DVC_DEVICE_TYPE", schema = "oa", catalog = "")
public class DeviceTypeEntity extends BaseEntity {
    private String deviceTypeName;
    private int sortNo;
    public String getDeviceTypeName() {
        return deviceTypeName;
    }

    public void setDeviceTypeName(String deviceTypeName) {
        this.deviceTypeName = deviceTypeName;
    }

    public int getSortNo() {
        return sortNo;
    }

    public void setSortNo(int sortNo) {
        this.sortNo = sortNo;
    }

    @Override
    public JSONObject getJSONObject() {
        JSONObject obj = new JSONObject();
        obj.put("ID", this.getId());
        obj.put("NAME", this.getDeviceTypeName());
        obj.put("SORT_NO", this.getSortNo());
        obj.put("DEL_FLAG", this.getDelFlag());
        return obj;
    }

    @Override
    public String getTableName() {
        return "T_DVC_DEVICE_TYPE";
    }

    @Override
    public JSONObject getJSONColumns() {
        JSONObject obj = new JSONObject();
        obj.put("ID", "id");
        obj.put("NAME", "name");
        obj.put("DEL_FLAG", "delFlag");
        obj.put("SORT_NO", "sortNo");
        return obj;
    }
}
